number = list(range(1, 10))

for n in number:
    if n == 1:
        print(str(n) + 'st')
    elif n == 2:
        print(str(n) + 'nd')
    elif n == 3:
        print(str(n) + 'rd')
    else:
        print(str(n) + 'th')
